/**
 * Created by gemini on 2017/4/24.
 */
/**
 * Created by gemini on 2017/4/24.
 */
myApp.controller('roomlistCtrl',function ($scope,$state,$cookieStore,$uibModal,roomService) {
    $scope.venue_id = $cookieStore.get("operator").venue_id;

    $scope.pages = {
        maxSize:5,
        pageSize:10,
        currentPage:1,
        totalPages:""
    };
    if(!$scope.venue_id == 0){
        roomService.roomList($scope.venue_id,$scope.pages.currentPage,$scope.pages.pageSize,function (data) {
            if(!data.errno == 0){
                alert(data.errmsg);
            }else{
            }
        });
    }

    $scope.openModal = function () {

        var modalInstance = $uibModal.open({
            templateUrl:'views/room/roomModal.html',
            controller:'roomModalCtrl',
            size:'sm',
            backdrop:true,
            resolve:{
                dataObj:{arr:$scope.arrs}
            }
        });
        modalInstance.result.then(function (selectedItem) {
            $scope.selected = selectedItem;
        });
    };
    //页面跳转
    $scope.jumpToUrl = function (targetUrl) {
        $state.go(targetUrl);
    };
});